package com.jdiv.samples.castlevania.applet;

import java.awt.AWTEvent;
import java.awt.Dimension;

import javax.swing.JApplet;

import com.jdiv.*;

/**
 * @author  Joyal
 */
public class Main extends JApplet{

	static int fpg_konami;
	static int fpg_castle;
	static int fpg_simon;
	static int fpg_piedra;
	/**
	 * @uml.property  name="castle"
	 * @uml.associationEnd  
	 */
	static JProcess castle;
	/**
	 * @uml.property  name="bpiedra"
	 * @uml.associationEnd  
	 */
	static JProcess bpiedra;
	/**
	 * @uml.property  name="simon"
	 * @uml.associationEnd  
	 */
	static JProcess simon;
	
	
	public void init(){
		  setPreferredSize(new Dimension(640,480));
		
		  enableEvents(AWTEvent.MOUSE_EVENT_MASK);
		  enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
		  enableEvents(AWTEvent.KEY_EVENT_MASK);
		
		  setIgnoreRepaint( true ) ;
		  add( JDiv.getCanvas()) ; 
		  JDiv.appletInit(JDiv.m320x240);
		
		}
	
	public void start(){
		
		JDiv.set_title("JDiv Test 7 - Castlevania");
		JDiv.scale_mode(JDiv.SCALENORMAL2X);
		
		fpg_konami=JDiv.load_fpg(getClass().getClassLoader().getResource("res/fpg/konami.fpg"));
		fpg_castle=JDiv.load_fpg(getClass().getClassLoader().getResource("res/fpg/castle1.FPG"));
		fpg_simon=JDiv.load_fpg(getClass().getClassLoader().getResource("res/fpg/simon.fpg"));
		fpg_piedra=JDiv.load_fpg(getClass().getClassLoader().getResource("res/fpg/enemigo_piedra.fpg"));
	
		new Konami();
	
	 
	}
	
	public void stop(){
		   JDiv.close();
		}

}
